import { InputType } from '@/utils/inputChange'

type IFormType =
  | 'input'
  | 'password'
  | 'textarea'
  | 'select'
  | 'cascade'
  | 'datePicker'
  | 'radio'
  | 'slot'
  | 'itemSlot'

export interface IFormItem {
  field: string
  type: IFormType
  label: string
  rules?: any[]
  placeholder?: any
  // 针对select | radio | cascade
  options?: any[]
  optionsKey?: string
  optionsValue?: string
  optionsChildren?: string
  // 针对特殊的属性
  otherOptions?: any
  isHidden?: boolean
  // 插槽
  slotName?: string
  // 输入类型
  inputType?: InputType
  itemStyle?: any
}

export interface IForm {
  formItems: IFormItem[]
  labelWidth?: string
  colLayout?: any
  itemStyle?: any
}
